package com.SouthernWall_404.age_tool.common.init;

import com.SouthernWall_404.age_tool.AgeTool;
import com.SouthernWall_404.age_tool.common.world.item.ChestLootCheckerItem;
import com.SouthernWall_404.age_tool.common.world.item.ExcuteBlockItem;
import com.google.common.collect.Sets;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.item.*;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.RegistryObject;

import java.util.LinkedHashSet;
import java.util.function.Supplier;

public class ModItems {

    public static final DeferredRegister<Item> ITEMS=DeferredRegister.create(Registries.ITEM, AgeTool.MODID);
    public static LinkedHashSet<RegistryObject<Item>> CREATIVE_TAB_ITEMS = Sets.newLinkedHashSet();


    public static RegistryObject<Item> registerWithTab(final String name, final Supplier<Item> supplier) {
        RegistryObject<Item> item = ITEMS.register(name, supplier);
        CREATIVE_TAB_ITEMS.add(item);


        return item;
    }



    public static final RegistryObject<Item> CHEST_LOOT_CHECKER = registerWithTab("chest_loot_checker",
            () -> new ChestLootCheckerItem(new Item.Properties()
                    .rarity(Rarity.UNCOMMON)
                    .stacksTo(1)
                    .fireResistant()
            ));
    public static final RegistryObject<Item> SUITCASE = registerWithTab("suitcase",
            () -> new Item(new Item.Properties()
                    .rarity(Rarity.UNCOMMON)
                    .stacksTo(1)
                    .fireResistant()

            ));
    public static final RegistryObject<Item> EXCUTER_BLOCK_ITEM=registerWithTab("excuter_block",
            ()->new ExcuteBlockItem(
                    ModBlocks.EXCUTER.get(),
                    new Item.Properties()
                            .rarity(Rarity.EPIC)
                            .stacksTo(64)
                            .fireResistant()
            )
    );
}
